<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcPromotionPintuanGroupTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_promotion_pintuan_group', function (Blueprint $table) {
            $table->increments('group_id');
            $table->integer('site_id')->comment('店铺ID');
            $table->integer('goods_id')->comment('商品ID');
            $table->integer('is_virtual_goods')->comment('是否虚拟商品');
            $table->integer('pintuan_id')->comment('拼团活动ID');
            $table->integer('head_id')->comment('团长ID');
            $table->integer('pintuan_num')->comment('拼团数量');
            $table->integer('pintuan_count')->comment('当前数量');
            $table->dateTime('end_time')->comment('拼团结束时间');
            $table->integer('status')->comment('当前状态 0未支付 1拼团失败 2.组团中3.拼团成功');
            $table->integer('is_virtual_buy')->comment('是否虚拟成团');
            $table->integer('is_single_buy')->comment('是否单独购买');
            $table->integer('is_promotion')->comment('是否团长优惠');
            $table->integer('buy_num')->comment('拼团限制购买');
            $table->string('head_member_img')->default('')->comment('组长会员头像');
            $table->string('head_nickname')->default('')->comment('组长会员昵称');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_promotion_pintuan_group');
    }
}
